<template>
	<view class="user-content">
		<Header :userCount='userCount' />
		<Order :userCount='userCount' />
		<Service />

	</view>
</template>

<script>
	import Header from "./components/header.vue";
	import Order from "./components/order.vue";
	import Service from "./components/service.vue"
	export default {
		components: {
			Header,
			Order,
			Service
		},
		data() {
			return {
				userCount: {}
			}
		},
		created() {
			uni.request({
				url: '/api/user/count',
				method: "GET",
				fail(err) {
					console.log(err)
				},
				success: res => {
					if (res) {
						res.data.money = parseFloat(res.data.money).toFixed(2)
						res.data.lipin = parseFloat(res.data.lipin).toFixed(2)
						this.userCount = res.data;
					}
				}
			})
		},
	}
</script>

<style>

</style>
